package io.github.weiranyi.controller;

import io.github.weiranyi.pojo.Product;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

// http://localhost:8000/serverinfo/getport,http://localhost:8001/serverinfo/getport
@RestController
@RequestMapping("/serverinfo")
public class ServerInfoController {

    @Value("${server.port}")
    private String serverPort;

    @RequestMapping("/getport")
    public String getPort(){
        System.out.println("端口号："+serverPort);
        return "端口号："+serverPort;
    }
}
